package com.future.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.future.allUtils.enums.ClassEnum;
import com.future.domain.DTO.AnswerDetailDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class GetAnswerSheetVO  {
    /**
     * 学生头像
     */
    private String avatar;
    /**
     * 学生的id
     */
    private Long userId;
    private String userIdStr;

    /**
     * 学生姓名
     */
    private String realName;
    /**
     * 班级
     */
    private String className;
    private Integer classId;
    /*
     *  答卷id
     * */
    private Long answerSheetId;
    /**
     * 总得分
     */
    private Integer totalScore;
    /**
     * 建议
     */
    private String suggestion;
    /**
     * 完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime completedAt;
    public String getUserIdStr(){
        if(userIdStr == null){
            return null;
        }
        return userId.toString();
    }
    /*
    * 回答详情
    * */
    private List<AnswerDetailDTO> answerList;
    /**
     * 问卷总分
     */
    private Integer QSCore;
    public String getClassName() {
        return ClassEnum.getClassNameByClassId(classId);
    }
}
